<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta charset="utf-8">
	<link rel="stylesheet" href="../../static/css/bootstrap.min.css">
	<link rel="stylesheet" href="../../static/css/ylb.css">
	<link rel="shortcut icon" href="../../static/img/logo.png">
	<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
	<script type="text/javascript" src="../../static/js/popper.min.js"></script>
	<script type="text/javascript" src="../../static/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../../static/js/qrcode.min.js"></script>
	<script type="text/javascript" src="../../static/js/clipboard.min.js"></script>
	<script type="text/javascript" src="./dwz.js"></script>
	<script type="text/javascript">
        var timestamp = new Date().getTime();
        var script = document.createElement('script');
        script.type = 'text/javascript';
        script.src = './dwz.js?v=' + timestamp;
        document.head.appendChild(script);
    </script>
</head>
<body>

<div id="app">
	
	<!-- 左侧 -->
	<div class="left">
		<div class="dhview">

			<!-- LOGO -->
			<a href="../index/" class="index">
			    <div class="logo"></div>
			</a>

			<!-- 导航 -->
			<ul>
			    <a href="../index/" >
			    <li class="nav-li">
			        <i class="icon i-data"></i>
			        <span class="nav-text">数据</span>
			    </li>
			    </a>
			    
			    <a href="../qun/">
			    <li class="nav-li">
			        <i class="icon i-hm"></i>
			        <span class="nav-text">活码</span>
			    </li>
			    </a>
			    
				<a href="../dwz/" class="selected">
				<li class="nav-li">
				    <i class="icon i-dwz-dark"></i>
				    <span class="nav-text">短网址</span>
				</li>
				</a>
				
				<a href="../tbk/">
				<li class="nav-li">
				    <i class="icon i-tbk"></i>
				    <span class="nav-text">淘宝客</span>
				</li>
				</a>
				
				<a href="../shareCard/">
				<li class="nav-li">
				    <i class="icon i-share"></i>
				    <span class="nav-text">分享卡片</span>
				</li>
				</a>
				
				<a href="../plugin/">
				<li class="nav-li">
				    <i class="icon i-plugin"></i>
				    <span class="nav-text">插件中心</span>
				</li>
				</a>
				
				<a href="../kami/">
				<li class="nav-li">
				    <i class="icon i-kami"></i>
				    <span class="nav-text">卡密分发</span>
				</li>
				</a>
				
				<a href="../config/">
				<li class="nav-li">
				    <i class="icon i-config"></i>
				    <span class="nav-text">配置中心</span>
				</li>
				</a>
				
				<a href="../sucai/">
				<li class="nav-li">
				    <i class="icon i-sucai"></i>
				    <span class="nav-text">素材管理</span>
				</li>
				</a>
				
				<a href="../user/">
				<li class="nav-li">
				    <i class="icon i-account"></i>
				    <span class="nav-text">账号管理</span>
			    </li>
			    </a>
			</ul>

			<!-- 账号 -->
			<div class="account">加载中...</div>
		    
		</div>
	</div>

	<!-- 右侧 -->
	<div id="right">
	    
		<h3>短网址</h3>
		<div class="data-card">
		    
			<!-- 按钮区域 -->
			<div class="button-view" id="button-view" style="display:none;">
			    
			    <!--flex布局按钮容器-->
			    <div class="flex-button-view">
			        
    			    <!--导航-->
    			    <div class="button-daohang">
    			        
    			        <button class="default-btn" style="margin-left:5px;">短网址</button>
    			        <span id="openApi"></span>
    			    </div>
    			    
    			    <!--功能-->
    			    <div class="button-gongneng">
    			        
    			        <button class="tint-btn" 
        				data-toggle="modal" 
        				data-target="#createDwzModal" 
        				onclick="getDomainNameList('creat')" style="margin-left:5px;">创建短网址</button>
        				
        				<button class="tint-btn" style="margin-left:5px;"
        				data-toggle="modal" 
        				data-target="#createBatchDwzModal" 
        				onclick="getDomainNameList('batchcreat')">批量创建</button>
        				
        				<div class="searchDwzForm">
        				    <input type="search" name="dwz_keyword" class="form-control" placeholder="短网址标题关键词或Key" />
        				    <button class="tint-btn checkDwz" onclick="checkDwz()">查询</button>
        				</div>
    			    </div>
			    </div><!-- flex-button-view -->
			</div>

			<!-- 列表区域 -->
			<div class="data-list">
				<table class="table">
				    <thead></thead>
				    <tbody></tbody>
				</table>
			</div><!-- data-list -->
			
			<p class="loading" style="display: none;"></p>
			
			<!-- 分页 -->
			<div class="fenye"></div>
			
		</div><!-- data-card -->
	</div><!-- right -->

	<!-- 创建短网址 -->
    <div class="modal fade" id="createDwzModal">
        <div class="modal-dialog">
            <div class="modal-content" style="width:700px;">
            
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">创建短网址</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 表单 -->
                <div class="modal-body">
                    <form id="createDwz">
                    <span class="text">标题</span>
                    <input type="text" name="dwz_title" class="form-control" autocomplete="off" placeholder="给你的短网址起一个标题">
                    
                    <div style="width:100%;height:70px;margin:-10px auto 20px;display:flex;">
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">短链域名</span>
                            <select name="dwz_dlym" class="form-control" title="短网址所使用的域名"></select>
                        </div>
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">入口域名</span>
                            <select name="dwz_rkym" class="form-control" title="点击短网址后先跳转到这个域名"></select>
                        </div>
                        <div style="flex:1;">
                            <span class="text">中转域名</span>
                            <select name="dwz_zzym" class="form-control" title="入口域名后跳转到这个域名"></select>
                        </div>
                    </div>
                    
                    <div style="width:100%;height:70px;margin:-10px auto 20px;display:flex;">
                        <div style="flex:1;margin-right:7px;">
                            <span class="text" style="display:block;">短链位数</span>
                            <select name="dwz_dlws" class="form-control" title="域名后面的参数位数">
                                <option value="4">4位数</option>
                                <option value="5">5位数</option>
                                <option value="6">6位数</option>
                                <option value="7">7位数</option>
                            </select>
                        </div>
                        <div style="flex:1;margin-right:7px;">
                            <span class="text" style="display:block;">访问限制</span>
                            <select name="dwz_type" class="form-control" title="限制访问的范围">
                                <option value="1">不限制</option>
                                <option value="2">仅限微信内访问</option>
                                <option value="3">仅限iOS设备访问</option>
                                <option value="4">仅限Android设备访问</option>
                                <option value="5">仅限手机浏览器访问</option>
                                <option value="6">仅限PC浏览器访问</option>
                            </select>
                        </div>
                        <div style="flex:1;">
                            <span class="text" style="display:block;">轮询域名</span>
                            <select name="dwz_lxymStatus" class="form-control" title="启用后：短链->入口->中转->轮询">
                                <option value="2">不启用</option>
                                <option value="1">启用</option>
                            </select>
                        </div>
                    </div>

                    <span class="text">目标链接</span>
                    <input type="text" name="dwz_url" class="form-control" autocomplete="off" placeholder="点击短网址后最终跳转到的链接">
                    <p style="color:#999;font-size:0.2rem;">需配置伪静态规则才可正常使用，否则404报错，具体阅读使用说明。</p>
                    </form>

                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer">
                    <div class="footer-btn">
                    <div class="faqnav" title="阅读使用指南">
                        <span class="faq"><a href="../faq.php?faq=dwz" target="_blank">?</a></span>
                    </div>
                    
                    <div class="btnnav">
                        <button type="button" class="default-btn" onclick="createDwz();">立即创建</button>
                    </div>
                    </div>
                </div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- createDwzModal -->
    
    <!-- 批量创建短网址 -->
    <div class="modal fade" id="createBatchDwzModal">
        <div class="modal-dialog">
            <div class="modal-content" style="width:700px;">
            
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">批量创建短网址</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 表单 -->
                <div class="modal-body">
                    <form id="createBatchDwz">
                    <div style="width:100%;height:70px;margin:-10px auto 20px;display:flex;">
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">短链域名</span>
                            <select name="dwz_dlym" class="form-control" title="短网址所使用的域名" id="dwz_dlym"></select>
                        </div>
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">入口域名</span>
                            <select name="dwz_rkym" class="form-control" title="点击短网址后先跳转到这个域名" id="dwz_rkym"></select>
                        </div>
                        <div style="flex:1;">
                            <span class="text">中转域名</span>
                            <select name="dwz_zzym" class="form-control" title="入口域名后跳转到这个域名" id="dwz_zzym"></select>
                        </div>
                    </div>
                    
                    <div style="width:100%;height:70px;margin:-10px auto 20px;display:block;">
                        <div style="width:48%;height:70px;float:left;">
                            <span class="text" style="display:block;">短链位数</span>
                            <select name="dwz_dlws" class="form-control" title="域名后面的参数位数" id="dwz_dlws">
                                <option value="4">4位数</option>
                                <option value="5">5位数</option>
                                <option value="6">6位数</option>
                                <option value="7">7位数</option>
                            </select>
                        </div>
                        <div style="width:48%;height:70px;float:right;">
                            <span class="text" style="display:block;">访问限制</span>
                            <select name="dwz_type" class="form-control" title="限制访问的范围" id="dwz_type">
                                <option value="1">不限制</option>
                                <option value="2">仅限微信内访问</option>
                                <option value="3">仅限iOS设备访问</option>
                                <option value="4">仅限Android设备访问</option>
                                <option value="5">仅限手机浏览器访问</option>
                                <option value="6">仅限PC浏览器访问</option>
                            </select>
                        </div>
                    </div>

                    <span class="text">目标链接</span>
                    <textarea class="form-control" 
                    name="dwz_urls" 
                    autocomplete="off" 
                    placeholder="将需要转换为短链接的Url粘贴到这里，一行一个" rows="5"></textarea>
                    
                    <!--显示创建的结果-->
                    <div class="createResult" style="display:none;">
                        <span class="text">生成结果</span>
                        <div class="form-control dwzCreateResult" contenteditable="true"></div>
                    </div>
                    </form>

                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer">
                    <div class="footer-btn">
                    <div class="faqnav" title="阅读使用指南">
                        <span class="faq"><a href="../faq.php?faq=dwz" target="_blank">?</a></span>
                    </div>
                    
                    <div class="btnnav">
                        <button type="button" class="default-btn" onclick="createBatchDwz()">立即创建</button>
                    </div>
                    </div>
                </div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- createDwzModal -->
  	
  	<!-- 编辑短网址 -->
    <div class="modal fade" id="EditDwzModal">
        <div class="modal-dialog">
            <div class="modal-content" style="width:700px;">
                
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">编辑短网址</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div>
                
                <!-- 表单 -->
                <div class="modal-body">
                <form id="editDwz">
                    <span class="text">标题</span>
                    <input type="text" name="dwz_title" class="form-control" autocomplete="off" placeholder="给你的短网址起一个标题">
                    
                    <div style="width:100%;height:70px;margin:-10px auto 20px;display:flex;">
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">短链域名</span>
                            <select name="dwz_dlym" class="form-control" title="短网址所使用的域名"></select>
                        </div>
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">入口域名</span>
                            <select name="dwz_rkym" class="form-control" title="点击短网址后先跳转到这个域名"></select>
                        </div>
                        <div style="flex:1;">
                            <span class="text">中转域名</span>
                            <select name="dwz_zzym" class="form-control" title="入口域名后跳转到这个域名"></select>
                        </div>
                    </div>
                    
                    <div style="width:100%;height:70px;margin:-10px auto 20px;display:flex;">
                        <div style="flex:1;margin-right:7px;">
                            <span class="text">短网址Key</span>
                            <input type="text" name="dwz_key" class="form-control" autocomplete="off" placeholder="你也可以自定义短网址Key">
                        </div>
                        <div style="flex:1;margin-right:7px;">
                            <span class="text" style="display:block;">访问限制</span>
                            <select name="dwz_type" class="form-control" title="限制访问的范围"></select>
                        </div>
                        <div style="flex:1;">
                            <span class="text" style="display:block;">轮询域名</span>
                            <select name="dwz_lxymStatus" class="form-control"></select>
                        </div>
                    </div>

                    <span class="text">目标链接</span>
                    <input type="text" name="dwz_url" class="form-control" autocomplete="off" placeholder="点击短网址后最终跳转到的链接">
                    
                    <!--隐藏域用于传参-->
                    <input type="hidden" name="dwz_id">
                </form>
                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer">
                    <div class="footer-btn">
                        
                    	<div class="faqnav" title="阅读使用指南">
                    	    <span class="faq"><a href="../faq.php?faq=dwz" target="_blank">?</a></span>
                    	</div>
                    	
                    	<div class="btnnav">
                    	    <button type="button" class="default-btn" onclick="editDwz();">立即保存</button>
                    	</div>
                    </div>
                </div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- EditDwzModal -->
  	
  	<!-- 确定删除短网址 -->
    <div class="modal fade" id="DelDwzModal">
        <div class="modal-dialog">
            <div class="modal-content">
                
                <!-- 头部 -->
                <div class="modal-header">
                    <h4 class="modal-title">删除短网址</h4>
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                </div><!-- modal-header -->
                
                <!-- 内容 -->
                <div class="modal-body">
                    将会删除该短网址！删除后将无法恢复！
                </div><!-- modal-body -->
                
                <!-- 底部操作 -->
                <div class="modal-footer"></div><!-- modal-footer -->
                
                <!-- 操作反馈 -->
                <div class="result"></div>
                
            </div><!-- modal-content -->
        </div><!-- modal-dialog -->
    </div><!-- DelDwzModal -->

    <!-- 全局信息提示框 -->
    <div id="notification">
        <div id="notification-text"></div>
    </div>
    
</div><!-- app -->

</body>
</html>